package cn.smbms.bean.vo;

import java.io.Serializable;

public class UserRoleVo implements Serializable {
	private static final long serialVersionUID = -8578588584194322155L;

	private String chnName; // staff用户名称
	private Integer pageRows = 4; // 每页的行数
	private Integer pageIndex = 1; // 第几页

	private Integer count;// 总页

	public Integer getCount() {
		int co;
		if (this.count % pageRows != 0) {
			co = this.count / pageRows + 1;
		} else {
			co = this.count / pageRows;
		}
		return co;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public UserRoleVo() {

	}

	public UserRoleVo(String name) {
		this.chnName = name;
	}

	private String msg; // 提示信息

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getChnName() {
		return chnName;
	}

	public void setChnName(String chnName) {
		this.chnName = chnName;
	}

	public Integer getPageRows() {
		return pageRows;
	}

	public void setPageRows(Integer pageRows) {
		if (null == pageRows || pageRows <= 0) {
			pageRows = 2;
		}
		this.pageRows = pageRows;
	}

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		if (null == pageIndex || pageIndex <= 0) {
			pageIndex = 1;
		}
		this.pageIndex = pageIndex;
	}

	public Integer getBegin() {
		return (pageIndex - 1) * pageRows;
	}
}